import request from '@/utils/request'

// 查询零件信息列表
export function listPartstInfo(query) {
  return request({
    url: '/project/partstInfo/list',
    method: 'get',
    params: query
  })
}

// 查询零件信息详细
export function getPartstInfo(id) {
  return request({
    url: '/project/partstInfo/' + id,
    method: 'get'
  })
}

// 新增零件信息
export function addPartstInfo(data) {
  return request({
    url: 'project/bomInfo/addBompartst',
    method: 'post',
    data: data
  })
}

// 修改零件信息
export function updatePartstInfo(data) {
  return request({
    url: '/project/partstInfo',
    method: 'put',
    data: data
  })
}

// 删除零件信息
export function delPartstInfo(id) {
  return request({
    url: '/project/partstInfo/' + id,
    method: 'delete'
  })
}
// 删除Bom下零件信息
export function delBomPartstInfo(id) {
  return request({
    url: '/project/bomInfo/delBompartst/' ,
    method: 'post',
    data:{
      "id": id
    }
  })
}
//删除BOM
export function delBom(id) {
  return request({
    url: '/project/bomInfo/' + id,
    method: 'delete'
  })
}
//新增bom 查询 接口
export function seeAbout(po) {
  return request({
    url: '/project/info/list',
    method: 'get',
    data:{
      "projectNo":po
    }
  })
}
// 新增BOM
export function Increased(lo,po,list) {
  return request({
    url: '/project/bomInfo',
    method: 'post',
    data:{
      "compomentNo":lo
      ,"projectNo":po
      ,"bomPartstRefList":list
    }
  })
}



// 绑定
export function bindingBom(data) {
  return request({
    url: '/project/bomInfo/bindingBom',
    method: 'post',
    data:data
  })
}
// 解绑
export function unbindingBom(data) {
  return request({
    url: '/project/bomInfo/unboundBom',
    method: 'post',
    data:data
  })
}



